1. Field of the Invention
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing data. Still more particularly, the present invention relates to a computer implemented method, apparatus, and computer usable program code for creating and ordering trace records.
2. Description of the Related Art
In order to reduce heat and power consumption, a data processing system may change the frequency of one or more processors. Alternatively, different processors in the same data processing system may have different fixed frequencies. The dynamic frequency changes may be caused by a variety of reasons. For example, a detection of overheating or excessive power consumption may cause a reduction in frequency in one or more processors. Additionally, a desire to reduce power consumption in a portable data processing system, such as a laptop, is another reason for changing frequencies based on usage. Other conditions also may cause changes in processor frequencies. For example, changes in processor frequencies may be based upon information about an application. For example, having knowledge that an application has a large number of cache misses may cause a lowering of processor frequency to reduce power since the overall performance may only be minimally affected due to the waiting for those cache misses.
This frequency change in processors during the operation of a data processing system increases difficulty in tracing events. Typically, separate processor buffers are used to record trace events. A trace record contains information or data about an event that occurs during a trace. The trace records stored in a buffer are referred to as a trace. The performance of a data processing system is identified through using a software performance tool, trace facility, or trace system. One known software performance tool is a trace tool. A trace tool may be used for more than one technique to provide trace information that indicated execution flows for an executing program. A trace may contain data about the execution of code. For example, a trace may contain trace records about events generated during the execution of the code. A trace may include information, such as, a process identifier, a thread identifier, and a program counter. Information in a trace may vary depending on a particular profile or analysis that is to be performed. A record is a unit of information relating to an event. For some applications, the correct ordering of the trace records are critical to the understanding of the item being analyzed. This ordering is especially important for understanding the exact flow of events, such as, may be necessary for problem determination. One way to achieve ordering is by using time stamps.
The ordering of trace records using time stamps is made difficult when frequencies of processors change. Typically, these time stamps and ordering of records are based on cycle information that is generated based on the frequency of a processor.
Thus, if the frequency of a processor changes, the time stamp typically assigned to the trace record may become inaccurate with respect to other trace records generated when the frequency of the processor was at a previous, different frequency with respect to trace records generated for other processors. This inaccuracy does not cause problems with respect to the order of trace records within a trace or a particular processor. The problem occurs when trace records are merged from different traces from different processors. With the variances in frequencies, an incorrect ordering of trace records from different traces may occur when these records are merged for analysis. Further, if different processors have different frequencies, the use of cycles to identify the times during which different states occur also may become misleading.